<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>欢迎使用校园卫士管理系统</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">  
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link  href="${pageContext.request.contextPath}/app/css/style.css" rel="stylesheet" /> 
	<link  href="${pageContext.request.contextPath}/app/css/login.css" rel="stylesheet" />
	<link  href="${pageContext.request.contextPath}/operamasks-ui/themes/default/om-default.css" rel="stylesheet"> 
	<script src="${pageContext.request.contextPath}/app/js/jquery-1.7.min.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/operamasks-ui/ui/operamasks-ui.js" type="text/javascript"></script>
<script type="text/javascript">
  $(function(){
	  $('#login').bind('click',function(){
		  var name = $('#userLoginId').val();
		  if(name == ''){
			  $.omMessageBox.alert({content:'请输入用户名！'});
			  return false;
		  }
	  });
	  
	  $('#loginForm').submit(function(){
		  $.ajax({
			  url : 'login!login.do',
			  data : {userLoginId:$('#userLoginId').val(),password:$('#password').val()},
			  method : 'POST',
			  dataType : 'json',
			  success : function(data){
				  if(data.success){
					  $.omMessageBox.waiting({title:'请等待',content:data.msg});
					  setTimeout(function(){
						  location.href = "${pageContext.request.contextPath}/app/mainframe/index.jsp";
					  },1000);
				  }else{
					  $.omMessageBox.alert({title:'登录错误',content:data.msg});
				  }
			  }
		  });
		  return false;
	  });
  });
  var islogin = '${sessionScope.user != null }';
  if(islogin == 'true'){
	   location.href = "${pageContext.request.contextPath}/app/mainframe/index.jsp";
  }
</script>	
  </head>
  
<body>
	<div class="header_login">
   	  <div class="light_save"></div>
    	<div class="logo"></div>
        <div class="light"></div>
    </div>
<div class="info">
    	<a href="#" class="condition">环境设置</a>
            	<a href="#" class="help">帮助</a>
        <a href="#" class="about">关于</a>
    </div>
	<div class="login_cont_3">
		<div class="cont_info_3">
		  <form id="loginForm">
        	<table width="100%" border="0" cellspacing="0" >
              <tr>
                <td align="right">登   录   名：</td>
                <td>
                <div class="text_light">
               	  <input name="userLoginId" id="userLoginId" type="text" />
                </div>
                </td>
              </tr>
              <tr>
                <td align="right">密&nbsp;&nbsp;&nbsp;码：</td>
                <td><div class="text_light">
                <input name="password" id="password" type="password"></div></td>
              </tr>
              <tr>
              	<td></td>
                <td><button type="submit" class="land"  id="login"></button></td>
              </tr>
            </table>
		</form>
        </div>
    </div>   
    <div class="light_bottom">
   	  <div class="bottom_logo"></div>
    </div>
</body>
</html>
